﻿@model DocProcessingWorkflow.Models.JobsAdmin.StockAssignmentViewModel
<div class="assignment-control mediadefinitionitem" data-mediadefinitionid="@Model.MediaDefinitionId" data-stocktype="@Model.StockType" data-displaystocktype="@Model.DisplayStockType" data-displaystocktypesingular="@Model.DisplayStockTypeSingular" data-allow-editing-station-numbers="@Model.AllowEditingStationNumbers.ToString().ToLower()">
  <h4>Assigned Items</h4>
  <div class="row">
    @Html.Partial("AssignmentExistingStockAjax", Model.ExistingStock)
    @if (Model.ExistingStock.Any())
    {
      <div class="text-right">
        <button id="btnEditStationNumbers" @(!Model.AllowEditingStationNumbers ? "disabled" : "") data-target-table='#assignedItems' type="button" class="btn btn-primary">Edit Station Numbers</button>
      </div>
    }
  </div>
  <h4>Available Items</h4>
  <div class="row">
    <div class="filter line"><input type='text' value='@Model.Filter' /></div>
    <button type="button" id="btnCreateNewStock" class="btn btn-primary line" data-toggle="modal" data-target="#stockCreationWindow">Create New Stock</button>
  </div>
  <div class="row">
    @Html.Partial("AssignmentAvailableStockAjax", Model.AvailableStock)
    <div class="text-right">
      <button id="btnAssignSelectedItems" disabled="disabled" data-target-table='#availableItems' type="button" class="btn btn-primary">Assign Selected Items</button>
    </div>
  </div>
</div>